<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Object的静态方法</title>
</head>

<body>
  <script>
    const obj = {
      uname: '张安',
      age: 14
    }
    // 获取对象的属性名,返回一个数组
    console.log(Object.keys(obj));

    // 获取对象的属性值,返回一个数组
    console.log(Object.values(obj));

    // 拷贝对象
    // 使用场景:给对象追加多个属性
    const objF = {}
    // Object.assign(objF, obj)
    // console.log(objF);
    Object.assign(objF, {
      hobby: '跳绳'
    })
    console.log(objF);
  </script>
</body>

</html>